package com.ruoyi.news.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.news.domain.XxcQuestion;
import com.ruoyi.news.mapper.XxcQuestionMapper;
import com.ruoyi.news.service.IXxcQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 小程序-问题反馈Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-06
 */
@Service
public class XxcQuestionServiceImpl implements IXxcQuestionService
{
    @Autowired
    private XxcQuestionMapper xxcQuestionMapper;

    /**
     * 查询小程序-问题反馈
     * 
     * @param id 小程序-问题反馈主键
     * @return 小程序-问题反馈
     */
    @Override
    public XxcQuestion selectXxcQuestionById(String id)
    {
        return xxcQuestionMapper.selectXxcQuestionById(id);
    }

    /**
     * 查询小程序-问题反馈列表
     * 
     * @param xxcQuestion 小程序-问题反馈
     * @return 小程序-问题反馈
     */
    @Override
    public List<XxcQuestion> selectXxcQuestionList(XxcQuestion xxcQuestion)
    {
        return xxcQuestionMapper.selectXxcQuestionList(xxcQuestion);
    }

    /**
     * 新增小程序-问题反馈
     * 
     * @param xxcQuestion 小程序-问题反馈
     * @return 结果
     */
    @Override
    public int insertXxcQuestion(XxcQuestion xxcQuestion, SysUser sysUser)
    {
        xxcQuestion.setCreateBy(sysUser.getUserId()+"");
        xxcQuestion.setCreateTime(DateUtils.getNowDate());
        return xxcQuestionMapper.insertXxcQuestion(xxcQuestion);
    }

    /**
     * 修改小程序-问题反馈
     * 
     * @param xxcQuestion 小程序-问题反馈
     * @return 结果
     */
    @Override
    public int updateXxcQuestion(XxcQuestion xxcQuestion)
    {
        xxcQuestion.setUpdateTime(DateUtils.getNowDate());
        return xxcQuestionMapper.updateXxcQuestion(xxcQuestion);
    }

    /**
     * 批量删除小程序-问题反馈
     * 
     * @param ids 需要删除的小程序-问题反馈主键
     * @return 结果
     */
    @Override
    public int deleteXxcQuestionByIds(String[] ids)
    {
        return xxcQuestionMapper.deleteXxcQuestionByIds(ids);
    }

    /**
     * 删除小程序-问题反馈信息
     * 
     * @param id 小程序-问题反馈主键
     * @return 结果
     */
    @Override
    public int deleteXxcQuestionById(String id)
    {
        return xxcQuestionMapper.deleteXxcQuestionById(id);
    }
}
